// vue.config.js
const path = require('path')
const resolve = (dir) => path.join(__dirname, dir);
module.exports = {
    publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',  // 公共路径
    outputDir: 'dist', // 'dist', 生产环境构建文件的目录
    assetsDir: 'static', // 相对于outputDir的静态资源(js、css、img、fonts)目录
    lintOnSave: false, // 是否在开发环境下通过 eslint-loader 在每次保存时 lint 代码
    configureWebpack: {
        // provide the app's title in webpack's name field, so that
        // it can be accessed in index.html to inject the correct title.
        name: '云祭祀',
        resolve: {
          alias: {
            '@': resolve('src')
          }
        }
      },
      css: {
        // css预设器配置项
        loaderOptions: {
          sass: {
            prependData:`@import "@/assets/styles/variables.scss";`
        }
      }
      },
    devServer: {
        port: 8080,
        open: true,
        overlay: {
          warnings: false,
          errors: true
        },
        proxy: {
          '/api': { 
            target: 'http://47.90.96.229:7772/',                 
            //target: 'http://192.168.1.158:7771',                 
            changeOrigin: true,
            pathRewrite: {
              "^/api": ""
            }
          }
        }
        }
}
